package com.nit.store.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.nit.store.pojo.entity.DictDistrict;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

/**
 * @Author J1ay
 * @Date 2022/7/21 19:27
 * @Description 省市区
 */
@Repository
public interface DistrictMapper extends BaseMapper<DictDistrict> {

    /**
     * 根据区号查找省市区名称
     * @param code
     * @return
     * @return
     */
    @Select("SELECT name FROM t_dict_district WHERE code = #{code}")
    String getNameByCode(@Param("code")String code);
}
